﻿using DocumentFormat.OpenXml.Lite.PresentationML.Presentation.Base;
using DocumentFormat.OpenXml.Lite.PresentationML.Presentation.Types;
using DocumentFormat.OpenXml.Lite.Shared;
using DocumentFormat.OpenXml.Lite.Xml;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Schema;
using System.Xml.Serialization;

namespace DocumentFormat.OpenXml.Lite.PresentationML.Presentation.SlideElements
{
    [XmlRoot("transition", Namespace = Constants.Presentation)]
    public class Transition : XmlSerializable
    {
        [Optional]
        [XmlAttribute("spd", Form = XmlSchemaForm.Qualified)]
        public Nullable<ST_TransitionSpeed> Speed { get; set; }

        [Optional]
        [XmlAttribute("advClick", Form = XmlSchemaForm.Qualified)]
        public Nullable<bool> AdvanceOnClick { get; set; }

        [Optional]
        [XmlAttribute("advTm", Form = XmlSchemaForm.Qualified)]
        public Nullable<uint> AdvanceAfterTime { get; set; }

        [Optional]
        [XmlElement("", Namespace = Constants.Presentation)]
        public ITransitionElement Element { get; set; }

        [Optional]
        [XmlElement("sndAc", Namespace = Constants.Presentation)]
        public SoundAction SoundAction { get; set; }

        [Optional]
        [XmlElement("extLst", Namespace = Constants.Presentation)]
        public ExtensionList ExtensionList { get; set; }

        public Transition() { }
    }

    #region Transitions

    [XmlRoot("blinds", Namespace = Constants.Presentation)]
    public class BlindsTransition : XmlSerializable, ITransitionElement
    {
        [Optional]
        [XmlAttribute("dir", Form = XmlSchemaForm.Qualified)]
        public Nullable<ST_Direction> Direction { get; set; }

        public BlindsTransition() { }
    }

    [XmlRoot("checker", Namespace = Constants.Presentation)]
    public class CheckerTransition : XmlSerializable, ITransitionElement
    {
        [Optional]
        [XmlAttribute("dir", Form = XmlSchemaForm.Qualified)]
        public Nullable<ST_Direction> Direction { get; set; }

        public CheckerTransition() { }
    }

    [XmlRoot("circle", Namespace = Constants.Presentation)]
    public class CircleTransition : XmlSerializable, ITransitionElement
    {
        public CircleTransition() { }
    }

    [XmlRoot("disslove", Namespace = Constants.Presentation)]
    public class DissolveTransition : XmlSerializable, ITransitionElement
    {
        public DissolveTransition() { }
    }

    [XmlRoot("comb", Namespace = Constants.Presentation)]
    public class CombTransition : XmlSerializable, ITransitionElement
    {
        [Optional]
        [XmlAttribute("dir", Form = XmlSchemaForm.Qualified)]
        public Nullable<ST_Direction> Direction { get; set; }

        public CombTransition() { }
    }

    [XmlRoot("cover", Namespace = Constants.Presentation)]
    public class CoverTransition : XmlSerializable, ITransitionElement
    {
        [Optional]
        [XmlAttribute("dir", Form = XmlSchemaForm.Qualified)]
        public Nullable<ST_TransitionEightDirection> Direction { get; set; }

        public CoverTransition() { }
    }

    [XmlRoot("cut", Namespace = Constants.Presentation)]
    public class CutTransition : XmlSerializable, ITransitionElement
    {
        [Optional]
        [XmlAttribute("thruBlk", Form = XmlSchemaForm.Qualified)]
        public Nullable<bool> TranstionThroughBlack { get; set; }

        public CutTransition() { }
    }

    [XmlRoot("diamond", Namespace = Constants.Presentation)]
    public class DiamondTransition : XmlSerializable, ITransitionElement
    {
        public DiamondTransition() { }
    }

    [XmlRoot("fade", Namespace = Constants.Presentation)]
    public class FadeTransition : XmlSerializable, ITransitionElement
    {
        [Optional]
        [XmlAttribute("thruBlk", Form = XmlSchemaForm.Qualified)]
        public Nullable<bool> TranstionThroughBlack { get; set; }

        public FadeTransition() { }
    }

    [XmlRoot("newsflash", Namespace = Constants.Presentation)]
    public class NewsflashTransition : XmlSerializable, ITransitionElement
    {
        public NewsflashTransition() { }
    }

    [XmlRoot("plus", Namespace = Constants.Presentation)]
    public class PlusTransition : XmlSerializable, ITransitionElement
    {
        public PlusTransition() { }
    }

    [XmlRoot("pull", Namespace = Constants.Presentation)]
    public class PullTransition : XmlSerializable, ITransitionElement
    {
        [Optional]
        [XmlAttribute("dir", Form = XmlSchemaForm.Qualified)]
        public Nullable<ST_TransitionEightDirection> Direction { get; set; }

        public PullTransition() { }
    }

    [XmlRoot("push", Namespace = Constants.Presentation)]
    public class PushTransition : XmlSerializable, ITransitionElement
    {
        [Optional]
        [XmlAttribute("dir", Form = XmlSchemaForm.Qualified)]
        public Nullable<ST_TransitionSideDirection> Direction { get; set; }

        public PushTransition() { }
    }

    [XmlRoot("random", Namespace = Constants.Presentation)]
    public class RandomTransition : XmlSerializable, ITransitionElement
    {
        public RandomTransition() { }
    }

    [XmlRoot("randomBar", Namespace = Constants.Presentation)]
    public class RandomBarTransition : XmlSerializable, ITransitionElement
    {
        [Optional]
        [XmlAttribute("dir", Form = XmlSchemaForm.Qualified)]
        public Nullable<ST_Direction> Direction { get; set; }

        public RandomBarTransition() { }
    }

    [XmlRoot("split", Namespace = Constants.Presentation)]
    public class SplitTransition : XmlSerializable, ITransitionElement
    {
        [Optional]
        [XmlAttribute("orient", Form = XmlSchemaForm.Qualified)]
        public Nullable<ST_Direction> Orient { get; set; }

        [Optional]
        [XmlAttribute("dir", Form = XmlSchemaForm.Qualified)]
        public Nullable<ST_TransitionInOutDirection> Direction { get; set; }

        public SplitTransition() { }
    }

    [XmlRoot("strips", Namespace = Constants.Presentation)]
    public class StripsTransition : XmlSerializable, ITransitionElement
    {
        [Optional]
        [XmlAttribute("dir", Form = XmlSchemaForm.Qualified)]
        public Nullable<ST_TransitionCornerDirection> Direction { get; set; }

        public StripsTransition() { }
    }

    [XmlRoot("wedge", Namespace = Constants.Presentation)]
    public class WedgeTransition : XmlSerializable, ITransitionElement
    {
        public WedgeTransition() { }
    }

    [XmlRoot("wheel", Namespace = Constants.Presentation)]
    public class WheelTransition : XmlSerializable, ITransitionElement
    {
        [Optional]
        [XmlAttribute("spokes", Form = XmlSchemaForm.Qualified)]
        public Nullable<uint> Spokes { get; set; }

        public WheelTransition() { }
    }

    [XmlRoot("wipe", Namespace = Constants.Presentation)]
    public class WipeTransition : XmlSerializable, ITransitionElement
    {
        [Optional]
        [XmlAttribute("dir", Form = XmlSchemaForm.Qualified)]
        public Nullable<ST_TransitionSideDirection> Direction { get; set; }

        public WipeTransition() { }
    }

    [XmlRoot("zoom", Namespace = Constants.Presentation)]
    public class ZoomTransition : XmlSerializable, ITransitionElement
    {
        [Optional]
        [XmlAttribute("dir", Form = XmlSchemaForm.Qualified)]
        public Nullable<ST_TransitionInOutDirection> Direction { get; set; }

        public ZoomTransition() { }
    }

    #endregion
}
